<?php

class m130816_112655_create_address_table extends CDbMigration
{
	public function up()
	{
		$this->createTable('{{addresses}}',array(
			'id'=>'pk',
			'client_id'=>'INT(11) NOT NULL',
			'region'=>'VARCHAR(255) NOT NULL',
			'city'=>'VARCHAR(255) NOT NULL',
			'street'=>'VARCHAR(255) NOT NULL',
			'house'=>'VARCHAR(255) NOT NULL',
			'housing'=>'VARCHAR(255) NULL DEFAULT NULL',
			'apartment'=>'VARCHAR(255) NOT NULL',
			'post_index'=>'INT(6) NOT NULL',
			'type'=>'INT(1) NOT NULL DEFAULT 1',
			'created_at'=>'DATETIME NOT NULL',
			'updated_at'=>'TIMESTAMP',
			'active'=>'INT(1) NOT NULL DEFAULT 1'
		));
	}

	public function down()
	{
		$this->dropTable('addresses');
	}

	/*
	// Use safeUp/safeDown to do migration with transaction
	public function safeUp()
	{
	}

	public function safeDown()
	{
	}
	*/
}